package cn.cq.admin.service.impl;

import cn.cq.admin.entity.dto.CourseDto;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import cn.cq.admin.entity.model.Course;
import cn.cq.admin.service.CourseService;
import cn.cq.admin.mapper.CourseMapper;
import org.springframework.stereotype.Service;

/**
* @author  dicraft
* @description 针对表【course】的数据库操作Service实现
* @createDate 2022-10-03 14:30:44
*/
@Service
public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course>
    implements CourseService{

    @Override
    public Page<Course> doList(CourseDto courseDto) {
        Page<Course> coursePage = new Page<>(courseDto.getPageNo(), courseDto.getPageSize());
        lambdaQuery()
                .like(StrUtil.isNotBlank(courseDto.getCourseName()),
                        Course::getCourseName, courseDto.getCourseName())
                .page(coursePage);
        return coursePage;
    }

    @Override
    public void doSave(CourseDto courseDto) {

    }
}




